package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Depot;
import cn.wolfcode.crm.mapper.DepotMapper;
import cn.wolfcode.crm.service.IDepotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class DepotServiceImpl implements IDepotService{

    @Autowired
    private DepotMapper depotMapper;

    public List<Depot> list() {
        List<Depot> list = depotMapper.selectAll();
        return list;
    }

    public void save(Depot d) {
        d.setInputTime(new Date());
        depotMapper.insert(d);
    }

    public void update(Depot d) {
        depotMapper.updateByPrimaryKey(d);
    }

    public void delete(Long id) {
        depotMapper.deleteByPrimaryKey(id);
    }
}


